-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix to handle multiple # in vocab URIs. #1242
base: skosmos-2
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this one needs a test case (which would serve as example of a use case too)
Thanks for the PR @pulquero ! Can you explain what the problem is? As I understood it, you have URIs with more than one hash character (why?) and these break the current getId() method. Like @kinow said above, a test case would be very good to have so that we know what exactly is being fixed here. I wouldn't be surprised if such URIs caused problems elsewhere too - I don't recall encountering more than one hash character in URIs. |
It is uncommon but still valid. Pushed testcase. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the test @pulquero .
Not sure if this is a valid URL. Had a look at some SO with links to MDN and RFC's, but it looks like some browsers still try to handle the multiple hashes.
I opened a new Firefox tab, and typed about:config
, then in the console window.location.hash
was empty. Navigated to about:config#test
, now the hash is #test
, then about:config#test#prueba
and now the has is #test#prueba
.
In this test the hash/fragment appears to be multiHashVocabId
. Can't say whether that's correct or not, but maybe somebody else can find another document or example to support one way or another 👍
I looked into it a bit deeper, and yes, multiple hashes are not valid. What I meant to do was #foo/bar, so I fixed that up on my side. With regards to this PR, I'm happy to withdraw it. But, maybe the existing behaviour should be changed as it neither throws an error that the input is invalid or gracefully does something that is unsuprising. Four options to be considered then: |
Thank you, it was interesting reading about it too (I never considered the possibility of multiple hashes.) Here's an interesting thread I found int he W3C list archives, though not conclusive 1
Sounds reasonable. Will leave it up to others, but I guess we could at least log a warn somewhere, if the decision is to not modify the code to handle the multiple hashes — no strong opinion from me. Thanks! Footnotes |
No description provided.